package com.hfzy.ihk.facade.linkcall.enums;

import com.hfzy.ihk.common.facade.CustomEnumType;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/7/19.
 * 知识库
 * 回答了客户之后做什么操作
 * @author wws
 */
public enum AfterAnswerOptionalType implements CustomEnumType {

    STOP("e", "挂机"),
    WAIT_CUSTOMER_ANSWER("o", "等待客户回答"),//这个暂时不要用
    ORIGIN_FLOW("n", "跳转到原主动流程"),
    ASSIGN("a", "跳转到指定主动流程");

    private AfterAnswerOptionalType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    private static Map<String, AfterAnswerOptionalType> map = new HashMap<>();
    static {
        for (AfterAnswerOptionalType value : AfterAnswerOptionalType.values()) {
            map.put(value.getValue(), value);
        }
    }

    public static AfterAnswerOptionalType fromValue(String value) {
        AfterAnswerOptionalType ret = map.get(value);
        if (ret != null) {
            return ret;
        } else {
            throw new IllegalArgumentException("No enum const " + AfterAnswerOptionalType.class + "." + value);
        }
    }

}
